package com.netease.research.service.impl;

import com.netease.research.common.ServerResponse;
import com.netease.research.dao.UserMapper;
import com.netease.research.pojo.User;
import com.netease.research.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("iUserService")
public class UserServiceImpl implements IUserService{
    @Autowired
    private UserMapper userMapper;
    @Override
    public ServerResponse<User> login(String username, String password){
        User user=userMapper.selectLogin(username,password);
        if(user!=null){
            user.setPassword("");
            return ServerResponse.createBySuccess(user);
        }
        return ServerResponse.createByError();
    }
}
